import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login.vue'
import Regist from '@/views/Regist.vue'
import Main from '@/views/Main.vue'
import Welcome from '@/views/Welcome.vue'
import Plan from '../components/Task/Plan.vue'
import ShopContract from '../components/Shop/ShopContract.vue'
import Analytics from '@/components/Data/Analytics.vue'
import ShopPlan from '@/components/Task/ShopPlan.vue'
import Contract from '../components/Task/Contract.vue'
import ShopReturns from '../components/Shop/ShopReturns.vue'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/login' },
    { path: '/login', component: Login },
    {
      path: '/regist',
      component: Regist

    },
    {
      path: '/main',
      component: Main,
      redirect: '/welcome',
      children: [
        { path: '/welcome', component: Welcome },
        { path: '/plan', component: Plan },

        { path: '/data', component: Analytics },
        { path: '/shop', component: ShopPlan },
        { path: '/contract', component: Contract },
        { path: '/shopcontract', component: ShopContract },
        { path: '/shopreturns', component: ShopReturns }
      ]
    }
  ],
  mode: 'history'
})

export default router
